<script type="text/javascript" src="{$smarty.const.TEMPLATE_DIR}debug/debug.js"></script>
<script type="text/javascript" src="{$smarty.const.TEMPLATE_DIR}predaj/predaj.js"></script>

<script type="text/javascript" src="{$smarty.const.LIB_DIR}js/ObjectBase.js"></script>
<script type="text/javascript" src="{$smarty.const.LIB_DIR}js/Seat.js"></script>
<script type="text/javascript" src="{$smarty.const.LIB_DIR}js/CustomObject.js"></script>
<script type="text/javascript" src="{$smarty.const.LIB_DIR}js/RoundTable.js"></script>

<script type="text/javascript" src="{$smarty.const.LIB_DIR}js/ReservationManager.js"></script>

<div style="width: 1300px">
    <div style="float: left; width: 200px;">
        <div id="reservation_details">
                <form id="order_search" action="predaj?action=search" method="POST">
                    Nr.: <input type="text" id="order_id" name="order_id"/>
                    <button class="input-text" id="search">Hľadaj</button>
                    <form/>
            {if isset($data.foundOrders) }
                <div class="order_details">
                    Nr.: {$data.foundOrders[0] -> id} </br>
                    Meno: {$data.foundOrders[0] -> user_name}</br>
                    Email: {$data.foundOrders[0] -> email}</br>
                   <!-- <div class="order_seats">
                        {foreach from=$data.foundOrderSeatsArray item="order_seat"}
                            <input type="checkbox" value="{$order_seat}" checked/>{$order_seat}  </br>
                        {/foreach}
                    </div>
                    -->
                    <input type="button" value="Zaplatit" onclick="payOrder({$data.foundOrders[0] -> id})"/>
                    <input type="button" value="Uvolnit" onclick="freeOrder({$data.foundOrders[0] -> id})"/>
                <div/>
            {/if}
        </div>
    </div>
    <div id="target" style=" float: left; width: 1100px; height: 1000px; background: #90ee90; position: relative;">
    </div>
</div>



<div id="help">
{include file="`$smarty.const.TEMPLATE_DIR`snippets/tut_miesta_more.tpl"}
</div>

{literal}
<script type="text/javascript">
var manager = new ReservationManager({
    target: "#target",
{/literal}
    reservedSeats: {$data.reservedSeats},
    userSeats:{$data.foundOrderSeats},
    orderedSeats: {$data.userOrderedSeats},
    reservationMode: {$data.reservation_mode},
    paidSeats: {$data.paid_seats}
{literal}
});
{/literal}
alert({$data.paid_seats});
{if isset($data.foundOrders)}
    var results = "";


    alert(results);
{/if}
{literal}
$("#help").dialog({
    autoOpen: false,
    title: "Nápoveda",
    width: 800
});



$(function(){
    manager.load();
});
</script>
{/literal}

{include file="`$smarty.const.TEMPLATE_DIR`snippets/plan_overlay.tpl" open=$data.open}
